Skip to content

feat: add OpenAI Responses API endpoint support#219

Open
Alex1Yuan wants to merge 1 commit into
ericc-ch:masterfrom
Alex1Yuan:feat/responses-api
Open

feat: add OpenAI Responses API endpoint support#219
Alex1Yuan wants to merge 1 commit into
ericc-ch:masterfrom
Alex1Yuan:feat/responses-api

Conversation

@Alex1Yuan

Copy link
Copy Markdown

Summary

  • Add /v1/responses and /responses endpoints that forward requests directly to GitHub Copilot's responses API
  • Enables support for responses-only models (gpt-5.4, gpt-5.3-codex, etc.)
  • Follows existing project patterns: rate limiting, manual approval, vision detection, X-Initiator header

Changes

  • src/services/copilot/create-responses.ts — Copilot responses API client
  • src/routes/responses/route.ts — Route registration with error handling
  • src/routes/responses/handler.ts — Request handler (streaming + non-streaming)
  • src/server.ts — Register new endpoints

Test plan

  • TypeScript type check passes (tsc --noEmit)
  • ESLint passes (pre-commit hook)
  • Tested gpt-5.4 non-streaming — returns correct response
  • Tested gpt-5.4 streaming — full SSE event chain works
  • Tested gpt-5.3-codex non-streaming — returns correct response
  • Verified gpt-4o correctly returns unsupported_api_for_model error
  • Existing endpoints unaffected (backward compatible)

Add /v1/responses and /responses endpoints that forward requests
directly to GitHub Copilot's responses API. This enables support
for responses-only models like gpt-5.4 and gpt-5.3-codex.
@caozhiyuan

caozhiyuan commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

@Alex1Yuan Duplicated with #170. You can use https://github.com/caozhiyuan/copilot-api (includes many advanced features). This repository hasn't been maintained for half a year.

@Alex1Yuan

Copy link
Copy Markdown
Author

@Alex1Yuan Duplicated with #170. You can use https://github.com/caozhiyuan/copilot-api (includes many advanced features). This repository hasn't been maintained for half a year.

Get it, thank you.

wenbo97 added a commit to wenbo97/copilot-api-cckyle that referenced this pull request Jun 18, 2026
…ress + endpoint router

Make /responses-only Copilot models (gpt-5.3-codex, gpt-5.5) reachable for the
Codex /v1/responses client, which previously 400'd with unsupported_api_for_model
because the proxy translated every surface down to /chat/completions.

- get-models.ts: surface supported_endpoints + capabilities.supports.reasoning_effort
  (previously dropped from the Model type)
- lib/endpoint-router.ts (new): modelSupportsEndpoint() reads the live catalog
- services/copilot/create-responses.ts (new): native POST /responses egress through
  the existing copilotFetch chokepoint (preserves 401-retry; diverges from PR ericc-ch#219 raw fetch)
- routes/responses/handler.ts: passthrough (no translation) when the target model is
  /responses-native; existing Codex->Claude translate-down path unchanged
- routes/models/route.ts: expose supported_endpoints in /models output
- tests: endpoint-router + create-responses unit tests; fix pre-existing
  create-chat-completions test (missing copilotTokenExpiresAt fired a token refresh)
- docs: mark P0 done + live-verified; .gitignore traces-*/; dev script drops --trace

Live-verified on :4142 against the enterprise backend: Codex->gpt-5.3-codex/gpt-5.5/
gpt-5.4 (incl. streaming + tool calls), Codex->claude translate-down, CC->claude
unchanged. bun test: 61 pass.

Unlocks Codex -> all model groups. CC -> gpt-5.5/codex (Messages->Responses bridge)
remains P1.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
wenbo97 added a commit to wenbo97/copilot-api-cckyle that referenced this pull request Jun 18, 2026
Document WHY the two cross-protocol fidelity-matrix paths are structurally lossy
for reasoning/thinking, backed by two adversarially-verified deep-research rounds
(45 primary sources, zero counterexamples) plus live byte-level probes against
the real enterprise Copilot backend.

New: docs/universal-proxy/cross-protocol-reasoning-research.md
- Root cause is dual: cryptographic opacity (signature/encrypted_content bound to
  issuer) AND missing target field (OpenAI Chat Completions has no thinking_blocks).
- Per-gateway behavior table (OpenAI/Anthropic/LiteLLM/OpenRouter/claude-code-router/
  Portkey/codex-responses-bridge): all carry reasoning same-protocol only, drop it,
  or fabricate a fake signature (CCR uses Date.now()).
- 4 live probes: Copilot rejects store:true (no server-side state), reasoning id is
  an encrypted blob with empty content/summary, same-protocol replay works, CC→Claude
  signature is native Anthropic passthrough.
- Refuted claims retained for honesty (incl. retracting "omission is officially
  sanctioned" — only "pass unchanged when included" survives verification).

DESIGN.md: drop two upstream PR ericc-ch#219 process references (out of scope for this
self-use fork) and link footnote 2 to the new research doc.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants